package com.share.shareplatform.sharereward.service.impl;

import com.share.shareplatform.pojo.Provide;
import com.share.shareplatform.sharereward.dao.ProvideDao;
import com.share.shareplatform.sharereward.service.ProvideService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProvideServiceImpl implements ProvideService {

    @Autowired
    private ProvideDao provideDao;

    @Override
    public Long addOne(Provide provide) {
        return provideDao.addOne(provide);
    }

    @Override
    public Integer updateBaseOne(Provide provide) {
        return provideDao.updateBaseOne(provide);
    }

    @Override
    public Integer deleteAllByIds(List<Long> ids) {
        return provideDao.deleteAllByIds(ids);
    }

    @Override
    public Provide findOneById(Long id) {
        return provideDao.findOneById(id);
    }

    @Override
    public List<Provide> findPage(Integer pageIndex, Integer pageSize) {
        return provideDao.findPage((pageIndex-1)*pageSize,pageSize);
    }

    @Override
    public List<Provide> findAllByIds(List<Long> ids) {
        return provideDao.findAllByIds(ids);
    }

    @Override
    public List<Provide> findAllByUserId(Long id) {
        return provideDao.findAllByUserId(id);
    }

    @Override
    public List<Provide> findAllByRewardId(Long id) {
        return provideDao.findAllByRewardId(id);
    }
}
